package Leo.webservice;


import org.apache.cxf.Bus;
import org.apache.cxf.jaxws.EndpointImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import javax.xml.ws.Endpoint;

@Configuration
public class CxfConfig {
    //webservice对外URL和内部的链接总线
    @Autowired
    Bus bus;

    @Autowired
    DemoWebservice demoWebservice;
    /**
     * 注册对外暴露的接口方法
     *
     * @return
     */
    @Bean
    public Endpoint sysRoleEndpoint() {
        EndpointImpl endpoint = new EndpointImpl(bus,demoWebservice);
        endpoint.publish("/demoWs");
        return endpoint;
    }
}
